import { cache } from '@/utils/methods.js'

const token_key = 'user_token'

export const getToken = () => {
  return cache('user_token', null) || ''
}

export const setToken = data => {
  return uni.setStorageSync(token_key, data)
}

export const removeToken = () => {
    return uni.removeStorageSync(token_key)
}

export const hasToken = () => {
    return !!getToken()
}